package com.hzj.controller;

import com.hzj.pojo.RefundInfo;
import com.hzj.service.RefundInfoService;
import com.hzj.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/consumer/admin/order/refundInfo/")
public class RefundInfoController {

    @Autowired
    private RefundInfoService ris;

    @PostMapping("queryRefundInfo")
    public Result queryRefundInfo(){
        return ris.queryRefundInfo();
    }

    @PostMapping("updateRefundInfo")
    public Result updateRefundInfo(@RequestBody RefundInfo refundInfo){
        return ris.updateRefundInfo(refundInfo);
    }

    @PostMapping("deleteRefundInfo/{outTradeNo}")
    public Result deleteRefundInfo(@PathVariable String outTradeNo){
        return ris.deleteRefundInfo(outTradeNo);
    }


    @PostMapping("querRefundInfoByOrderId/{orderId}")
    public Result querRefundInfoByOrderId(@PathVariable Integer orderId){
        return Result.ok(ris.querRefundInfoByOrderId(orderId));
    }
}
